<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>jquery请求</title>
</head>

<body>
  <div id="root">
    <ul>
      <li v-for="item in movies" :key="item.id">
        {{ item.showInfo }}
      </li>
    </ul>
  </div>

  <script src="./js/vue.js"></script>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.js"></script>
  <script>
    new Vue({
      el: '#root',
      data: {
        // 电影列表数据
        movies: []
      },
      async mounted() {
        // 网络请求地址
        const url = 'http://127.0.0.1:5500/data/db.json'
        // get请求
        let ret = await fetch(url,{
          // 请求方法 默认get请求 GET/POST/PUT/DELETE
          method:'GET',
          // FETCH 默认不发送cookie，需要发送cookie指定
          credentials: "include"
        })
        // text
        let data = await ret.json()
        console.log(data)

        /* let data = await (await fetch(url)).json()
        console.log(data) */
      }
    })
  </script>
</body>

</html>